package com.study.algorithm.datastruct.tree.model;

public class BinaryTreeNode {

    private BinaryTreeNode rightChildNode;
    private BinaryTreeNode leftChildNode;


    public BinaryTreeNode getRightChildNode() {
        return rightChildNode;
    }

    public void setRightChildNode(BinaryTreeNode rightChildNode) {
        this.rightChildNode = rightChildNode;
    }

    public BinaryTreeNode getLeftChildNode() {
        return leftChildNode;
    }

    public void setLeftChildNode(BinaryTreeNode leftChildNode) {
        this.leftChildNode = leftChildNode;
    }


    public boolean hasChildNode() {
        return hasLeftChildNode() || hasRightChildNode();
    }

    public boolean hasRightChildNode() {
        return rightChildNode != null;
    }

    public boolean hasLeftChildNode() {
        return leftChildNode != null;
    }


    public void removeRightChildNode() {
        setRightChildNode(null);
    }

    public void removeLeftChildNode() {
        setLeftChildNode(null);
    }

}
